package com.wyy.servlet.web;

import com.wyy.bean.Grade;
import com.wyy.service.impl.GradeServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @ClassName GradeListServlet
 * @Description //TODO
 * @Author wky
 * @Date 2021/9/16 20:42
 * @Version 1.0
 **/
@WebServlet(urlPatterns = "/Educational/student/getGradeList")
public class GradeListServlet extends HttpServlet {
    
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取参数信息
        
        //调用service
        GradeServiceImpl gradeService = new GradeServiceImpl();
        List<Grade> gradeList = gradeService.getList();
        req.setAttribute("gradeList",gradeList);
        //跳转页面
        req.getRequestDispatcher("add.jsp").forward(req,resp);
    }
}
